<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet"  type="text/css"  href="/lib/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet"  type="text/css" href="/css/goodslist.css">
    <style>
        thead tr{
            background-color: rgba(102,102,102,1);
            color: #fff;
        }
        table{
            background: #FFFFFF;
            border: 1px solid #CCCCCC;
            border-radius: 2px;
        }
        tbody tr:nth-child(odd){
            background-color: #FAFAFA;
        }
        input[type=checkbox]{
            width: 14px;
            height: 14px;
        }
        .text{

            font-size: 10px;
            color: #999
        }
        p{
            margin: 0 auto;
            overflow:hidden;
            text-overflow:ellipsis;
            display:-webkit-box;
            -webkit-box-orient:vertical;
            -webkit-line-clamp:2;
        }
    </style>
</head>
<body>
<div class="goodslist-wrapper" style="padding: 0 30px 0 30px">
    <!--  <h3 class="title">订单列表</h3>
      <hr>-->
    <div>
        <ul class="nav nav-tabs" role="tablist">
            <li role="presentation" ><a href="{:url('admin/order/index')}" >所有订单 <i>（{$list['order']}）</i></a></li>
            <li role="presentation" ><a href="{:url('admin/order/remindOrders')}">提醒发货<i>({$list['remind']})</i></a></li>
            <li role="presentation" ><a href="{:url('admin/order/refundOrders')}" >退款/售后<i>({$list['refund']})</i></a></li>
            <li role="presentation"><a href="{:url('admin/order/pendingPayOrders')}" >待付款<i>({$list['pendingPay']})</i></a></li>
            <!--<li role="presentation"><a href="" >上架商品<i>()</i></a></li>-->
            <li role="presentation" ><a href="{:url('admin/order/pendingSendOrders')}" >待发货<i>({$list['pendingSend']})</i></a></li>
            <li role="presentation" ><a href="{:url('admin/order/finishOrders')}" >已完成<i>({$list['finish']})</i></a></li>
            <li role="presentation"  class="active"><a href="{:url('admin/order/closeOrders')}" >已关闭<i>({$list['close']})</i></a></li>
            <li role="presentation" ><a href="{:url('admin/order/abnormalOrders')}" >用户已删除<i>({$list['abnormal']})</i></a></li>
        </ul>
        <div class="row czrow" >
            <form class="col-sm-3 form-inline" method="post" action="">
                <div class="form-group">
                    <input type="text" class="form-control"  class="search" name="search" placeholder="订单编号">
                    <button type="submit" class="btn btn-danger" id="submit"><span class="glyphicon glyphicon-search"></span></button>
                </div>
            </form>
            <div class="col-sm-4"><a
                    href="javascript:window.location.reload();" class="btn btn-default" style="margin-left: 20px"><span class="glyphicon glyphicon-repeat"></span> 刷新-共 <i>{$list['close']}</i>条记录</a> </div>
        </div>

        <div class="tab-content">
            <form action="">
                <table class="table "style="text-align: center">
                    <thead style="border: 1px solid #BBBBBB;background-color:#eeeeee;" >
                    <tr style="border-bottom: 1px solid #BBBBBB">
                        <td style="text-align: left"><span style="margin-left: 10px">订单编号</span></td>
                        <td>商品信息</td>
                        <td>支付账号</td>
                        <td>订单状态</td>
                        <td>收货人手机号</td>
                        <td>买家留言</td>
                        <td>备注</td>
                        <td>操作</td>
                    </tr>
                    </thead>
                    <tbody>
                    {foreach $closeOrders as $order}

                    <tr>
                        <td >

                            <p class="good_order"><i class="order">{$order['order_number']}</i></p>
                            <p class="good-name text">下单时间：<i></i></p>
                            <p class="text">{$order['create_time']}</p>
                        </td>

                        <td>
                            {if condition="count($order->orderGoodsInfos) eq 1"}
                            {foreach $order->orderGoodsInfos as $val }
                            <img src="{$val->goods['image_path']}" style="display: inline-block;width: 50px;height: 50px;margin: 0 auto" >
                            <p  style="width: 150px;"  >{$val->goods['shop_name']}</p>
                            <p>({$val['shop_num']}件)</p>
                            <p class="good-name" style="">总价:¥ <i>{$val['shop_total']}</i> <i>(运费:{$val->goods['freight']})</i></p>
                            {/foreach}
                            {elseif condition="count($order->orderGoodsInfos) eq 2"}
                            {foreach $order->orderGoodsInfos as $good}
                            <img src="{$good->goods['image_path']}" style="display: inline-block;width: 50px;height: 50px;margin: 0 auto" >
                            {/foreach}
                            <p class="good-brand">总物件: <i>({$order['shop_num_sum']}件)</i></p><br>
                            <p class="good-name">总价:¥ <i>{$order['order_money']}</i> <i>(运费:{$order['freight']})</i></p>
                            {else /}
                            <p style="font-weight: bold">
                                <img src="{$order->orderGoodsInfos[0]->goods['image_path']}" style="display: inline-block;width: 50px;height: 50px;margin: 0 auto ;vertical-align: middle" >
                                <img src="{$order->orderGoodsInfos[1]->goods['image_path']}" style="display: inline-block;width: 50px;height: 50px;margin: 0 auto ;vertical-align: middle" >
                                .....
                            </p>
                            <p class="good-brand">总物件: <i>({$order['shop_num_sum']}件)</i></p><br>
                            <p class="good-name">总价:¥ <i>{$order['order_money']}</i> <i>(运费:{$order['freight']})</i></p>
                            {/if}
                        </td>
                        <td>
                            {if condition="$order['pay_status'] eq 1"}
                            <div class="payed">已支付</div>
                            <div > <span class="good-price">{$order['pay_number']}
                                <i>(
                                {if condition="$order['pay_staff']" == 1}
                                银行卡
                                {elseif condition="$order['pay_staff']" == 2}
                                支付宝
                                {elseif condition="$order['pay_staff']" == 3}
                                微信
                                {/if}
                                )</i></span></div>
                            <div >支付时间： <span class="good-price">{$order['pay_time']|date="Y-m-d h:i:s",###} </span></div>
                            {elseif condition="$order['pay_status'] eq 0 "}
                            <div class="notpay">未支付</div>
                            {/if}
                        </td>
                        <td>
                            {if condition="($order.pay_status eq 0) AND ($order.order_staff eq 1)"}
                            <div >待付款</div>
                            <!--<div >自动取消订单时间：<br> <span class="good-price">2017-10 07:10</span></div>-->
                            {elseif condition="$order.user_remind eq 1 AND $order.order_staff eq 2 AND $order.freight_staff eq 0 " /}
                            <div >买家提醒发货</div>
                            <div >提醒时间： <span class="good-price">{$order.remind_time|date="Y-m-d h:i:s",###}</span></div>
                            {elseif condition="$order.pay_status eq 1 AND $order.order_staff eq 2" /}
                            <div >已付款</div>
                            <!--<div >自动确认时间： <span class="good-price">{$order.pay_time||date="Y-m-d h:i:s",###}</span></div>-->
                            {elseif condition="($order.pay_status eq 1) AND ($order.order_staff eq 3) AND ($order.freight_staff eq 2)" /}
                            <div >交易成功</div>
                            <div >成交时间： <span class="good-price">{$order.finish_time|date="Y-m-d h:i:s",###}</span></div>
                            {elseif condition="($order.pay_status eq 1) AND ($order.order_staff eq 5) AND ($order.freight_staff eq 2)" /}
                            <div >退款申请</div>
                            <!--<div>退款编号：<i>ECs5865856</i></div>-->
                            <!--<div >自动确认时间： <span class="good-price">{$order.refund_time|date="Y-m-d h:i:s",###}</span></div>-->
                            {elseif condition="($order.pay_status eq 1) AND ($order.order_staff eq 6) AND ($order.freight_staff eq 2)" /}
                            <div >退款成功</div>
                            <!--<div>退款编号：<i>ECs5865856</i></div>-->
                            <!--<div >自动确认时间： <span class="good-price">{$order.refund_finish_time|date="Y-m-d h:i:s",###}</span></div>-->
                            {elseif condition="($order.pay_status eq 0) AND ($order.order_staff eq 4) " /}
                            <div >交易关闭</div>
                            <div >关闭时间：<br> <span class="good-price">{$order.close_time|date="Y-m-d h:i:s",###}</span></div>
                            {/if}
                        </td>
                        <td>
                            <div>{$order['buyer_name']}</div>
                            <div>{$order['buyer_phone']}</div>

                        </td>
                        <td>
                            <button type="button" class="btn btn-default btn-xs" data-toggle="tooltip" data-placement="top" title="{$order['buyer_message']}">查看</button>
                            <!--<p class="leaveboxorderTablerder['buyer_message']}</p>-->
                        </td>
                        <td>
                            <input type="text" class="Remarks" value="{$order['remarks']}">
                        </td>
                        <td>
                            {if condition="($order.pay_status eq 0) AND ($order.order_staff eq 1)"}
                            <ul>
                                <li class="text">买家未付款</li>
                                <!-- <li><a href="javascript:;" class="btn btn-default btn-xs">短信提醒</a></li>-->
                                <li><a href="{:url('admin/order/orderDetail',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">详情</a></li>
                                <!--<li><a href="{:url('admin/order/orderDelete',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">删除</a></li>-->
                            </ul>
                            {elseif condition="($order['order_staff'] == 2) AND ($order['user_remind'] == 1) AND ($order['freight_staff'] == 0)"}
                            <ul>
                                <li class="text">买家提醒发货</li>
                                <li><a href="{:url('admin/order/queryOrder',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">操作</a></li>
                                <!--<li><a href="{:url('admin/order/orderDelete',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">删除</a></li>-->
                            </ul>
                            {elseif condition="($order['order_staff'] == 2) AND ($order['freight_staff'] == 0)"}
                            <ul>
                                <li class="text">等待发货</li>
                                <li><a href="{:url('admin/order/queryOrder',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">操作</a></li>
                                <!--<li><a href="{:url('admin/order/orderDelete',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">删除</a></li>-->
                            </ul>
                            {elseif condition="($order['order_staff'] == 2) AND ($order['freight_staff'] == 1)"}
                            <ul>
                                <li class="text">已发货</li>
                                <li><a href="{:url('admin/order/orderDetail',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">详情</a></li>
                                <!--<li><a href="javascript:;" class="btn btn-default btn-xs">物流</a></li>-->
                                <!--<li><a href="{:url('admin/order/orderDelete',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">删除</a></li>-->
                            </ul>
                            {elseif condition="($order['order_staff'] == 3) AND ($order['freight_staff'] == 2)  "}
                            <ul>
                                <li class="text">买家已收货</li>
                                <li><a href="{:url('admin/order/orderDetail',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">详情</a></li>
                                <!--<li><a href="{:url('admin/order/orderDelete',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">删除</a></li>-->
                            </ul>
                            {elseif condition="($order.pay_status eq 0) AND ($order.order_staff eq 4) "}
                            <ul>
                                <li class="text">买家关闭交易</li>
                                <li><a href="{:url('admin/order/orderDetail',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">详情</a></li>
                                <!--<li><a href="{:url('admin/order/orderDelete',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">删除</a></li>-->
                            </ul>
                            {elseif condition="($order.pay_status eq 1) AND ($order.order_staff eq 5) AND ($order.freight_staff eq 2)" /}
                            <ul>
                                <li class="text">等待退款</li>
                                <li><a href="javascript:;" class="btn btn-default btn-xs">退款</a></li>
                                <li><a href="{:url('admin/order/orderDetail',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">详情</a></li>
                                <!--<li><a href="javascript:;" class="btn btn-default btn-xs">退款物流</a></li>-->
                                <!--<li><a href="{:url('admin/order/orderDelete',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">删除</a></li>-->
                            </ul>
                            {elseif condition="($order.pay_status eq 1) AND ($order.order_staff eq 6) AND ($order.freight_staff eq 2)" /}
                            <ul>
                                <li>已退款</li>
                                <li><a href="{:url('admin/order/orderDetail',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">详情</a></li>
                                <!--<li><a href="javascript:;" class="btn btn-default btn-xs">退款物流</a></li>-->
                                <!--<li><a href="{:url('admin/order/orderDelete',['order_number'=>$order['order_number']])}" class="btn btn-default btn-xs">删除</a></li>-->
                            </ul>
                            <ul></ul>
                            {else /}
                            {/if}
                        </td>
                    </tr>
                    {/foreach}
                    </tbody>
                </table>
            {$closeOrders->render()}
            </form>
        </div>
    </div>
</div>
<script src="/lib/jquery/jquery.min.js"></script>
<script src="/lib/bootstrap/js/bootstrap.min.js"></script>
<script>
    $(function () {
        $('[data-toggle="tooltip"]').tooltip()
    })

    $(".Remarks").each(function (index,item) {
        var value="";
        $(this).focus(function () {
            value=$($(".Remarks").get(index)).val();
        });
        $(this).blur(function () {
            var valueafter=$($(".Remarks").get(index)).val();
            var order_num = $($(".order").get(index)).html();
            if(value!==valueafter){
                $.ajax({
                    url:"orderRemarks",
                    data:{"remarks":valueafter, 'order_num':order_num},
                    type:"post",
                    success:function (val) {

                    }
                })
            }
        })
    });

</script>
<script src="/js/nosearch.js"></script>

</body>
</html>